Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOISUE - Fix cache error when key is not in Redis #1220

Merged
merged 3 commits into from
Jul 14, 2020

Conversation

dborovcanin
Copy link
Collaborator

Signed-off-by: dusanb94 dusan.borovcanin@mainflux.com

What does this do?

This pull request fixes an error Things service throws in case that key is not present in Redis. In that case, Redis returns an error, which is actually nil but is not nil type.

Which issue(s) does this PR fix/relate to?

There is no such issue.

List any changes that modify/break current functionality

There are no changes that modify current functionality.

Have you included tests for your changes?

No.

Did you document any new/modified functionality?

No.

@dborovcanin dborovcanin requested a review from a team as a code owner July 14, 2020 15:36
@dborovcanin dborovcanin force-pushed the fix-auth-cache branch 2 times, most recently from 6d13a34 to f101bf3 Compare July 14, 2020 15:37
var ErrRedisThingSave = errors.New("saving thing in redis cache error")
var (
// ErrRedisThingSave indicates error while saving Thing in redis cache
ErrRedisThingSave = errors.New("saving thing in redis cache error")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failed to save thing in redis cache

// ErrRedisThingID indicates error while geting Thing ID from redis cache
var ErrRedisThingID = errors.New("get thing id from redis cache error")
// ErrRedisThingID indicates error while geting Thing ID from redis cache
ErrRedisThingID = errors.New("get thing id from redis cache error")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failed to get thing id from redis cache

// ErrRedisThingRemove indicates error while removing Thing from redis cache
var ErrRedisThingRemove = errors.New("remove thing from redis cache error")
// ErrRedisThingRemove indicates error while removing Thing from redis cache
ErrRedisThingRemove = errors.New("remove thing from redis cache error")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failed to remove thing from redis cache

@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2020

Codecov Report

Merging #1220 into master will decrease coverage by 0.56%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1220      +/-   ##
==========================================
- Coverage   77.44%   76.87%   -0.57%     
==========================================
  Files         104      106       +2     
  Lines        6875     6961      +86     
==========================================
+ Hits         5324     5351      +27     
- Misses       1164     1212      +48     
- Partials      387      398      +11     
Impacted Files Coverage Δ
things/api/things/http/transport.go 90.72% <0.00%> (-1.27%) ⬇️
things/redis/channels.go 73.91% <ø> (ø)
things/redis/things.go 71.42% <100.00%> (-5.50%) ⬇️
things/service.go 84.89% <0.00%> (-1.44%) ⬇️
pkg/messaging/nats/publisher.go 26.31% <0.00%> (ø)
pkg/messaging/nats/pubsub.go 39.34% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1088b9...1dd8880. Read the comment docs.

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Copy link
Contributor

@manuio manuio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@drasko drasko merged commit be13613 into absmach:master Jul 14, 2020
manuio pushed a commit that referenced this pull request Oct 12, 2020
* Fix cache error when key is not in Redis

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix errors message

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
@dborovcanin dborovcanin deleted the fix-auth-cache branch June 13, 2022 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants